<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isArrayLike</title>
</head>

<body>
    <script>
        const isArrayLike = obj =>
            obj !== null && typeof obj[Symbol.iterator] === 'function';
        console.log(isArrayLike([1, 2, 3]), isArrayLike(document.querySelectorAll('.className')));
    </script>
</body>

</html>